package models;

import java.util.Date;

import javax.persistence.Entity;
import javax.persistence.Lob;
import javax.persistence.ManyToMany;
import javax.persistence.ManyToOne;

import play.data.validation.Required;
import play.db.jpa.Model;

@Entity
public class Comment extends Model{

	@Required
	public String author;
	@Required
	public Date postedAt;
	@Required
	@ManyToOne
	public Event event;

	@Required
	@Lob
	public String content;

	public Comment() {
		// TODO Auto-generated constructor stub
	}
	public Comment(String auteur,Event e,String comment){
		this.author = auteur;
		this.content = comment;
		this.event = e;
		this.postedAt = new Date();
	}
}
